@extends('admin::layouts.master')

@section('content')
    <form action="{{route('distributionrole',$admin)}}" method="post">
        @csrf
    <div class="col-lg-12">
        <div class="card">
            <div class="card-header">为 {{$admin['nickname']}} 分配角色</div>
            <div class="card-body">
                <div class="form-group row pt-1 pb-1">
                    <div class="col-12 col-sm-8 col-lg-6 form-check mt-2">
                        @foreach($role as $v)
                        <label class="custom-control custom-checkbox custom-control-inline">
                            <input type="checkbox" @if($admin->hasRole($v['name'])) checked @endif value="{{$v['name']}}" name="name[]"  class="custom-control-input"><span class="custom-control-label custom-control-color">{{$v['title']}}</span>
                        </label>
                        @endforeach
                    </div>

                </div>

            </div>

        </div>
    </div>
        <button class="btn btn-space btn-primary btn-lg" type="submit" style="float: right">保存</button>
</form>
@stop